Carbon


SndStopFilePlay

Header: Sound.h Carbon status: Unsupported

Stops an asynchronous play from disk.

OSErr SndStopFilePlay (
    SndChannelPtr chan, 
    Boolean quietNow
);
Parameter descriptions
chan

A pointer to a valid sound channel currently processing a play from disk initiated by a call to the SndStartFilePlay function.

quietNow

A Boolean value that indicates whether the play from disk should be stopped immediately (TRUE) or when it completes execution (FALSE).

function result

A result code.

DISCUSSION

The SndStopFilePlay function either can stop an asynchronous play from disk immediately or can take control of the CPU until a play from disk finishes. The SndStopFilePlay function does not return until all asynchronous file I/O calls have completed and any internally allocated memory has been released. If async is FALSE, then SndStopFilePlay lets the sound complete normally and returns only after the sound has completed, all asynchronous file I/O calls have completed, and any internal allocated memory has been released.

For example, you might use the function to stop the playing of a sound file if the user selects an option that turns off sound output while the file is already playing. In that case, you would pass TRUE to quietNow. Alternatively, you might have started a sound playing asynchronously so that you could perform other tasks while the sound plays. But you might then finish those other tasks and want to convert the play from disk into a synchronous play. By passing FALSE to quietNow, you effectively achieve that.

SPECIAL CONSIDERATIONS

Because the SndStopFilePlay function might move memory, you should not call it at interrupt time.

AVAILABILITY

Not supported in Carbon. Not available in Carbon.

CARBON NOTES

You should instead use QuickTime to play sound files. Open a sound file as a QuickTime movie and play the movie back. This approach supports more audio formats (like wav and mp3) than this call supported.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)